package com.cy1;

import java.io.File;
import java.io.IOException;

public class FileDemo2 {
    public static void main(String[] args) throws IOException {
        File file = new File("D:\\Project\\Java\\java.txt");
        System.out.println(file.createNewFile());
        File file1 = new File("D:\\Project\\Java\\file测试目录");//单级目录
        System.out.println(file1.mkdir());
        File file2 = new File("d:\\Project\\Java\\JavaWeb\\HTML");
        System.out.println(file2.mkdirs());
        File file3 = new File("D:\\Project\\Java\\JavaWeb");
        System.out.println("------------------------");
        File file4 = new File("D:\\Project\\Java\\firstaaaaaa");
        System.out.println(file4.delete());
        System.out.println(file4.exists());


        System.out.println(file1.delete());
        System.out.println(file2.delete());
        System.out.println(file3.delete());
//        System.out.println(file1.delete());


    }
}
